import java.util.concurrent.atomic.AtomicReference;

/**
 * @ClassName A4
 * @Description
 * @Author Jingxiao.Ye
 * @Date 2021/11/28 下午11:22
 * @Version V1.0
 * @Since JDK 11
 */
public class A4 {

    public static void main(String[] args) throws InterruptedException {
        AtomicReference<Integer> resRef = new AtomicReference<>();
        Thread thread = new Thread(() -> {
            try {
                resRef.set(new Task().call());
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        thread.start();
        Integer res = null;
        while ((res = resRef.get()) == null)
            Thread.sleep(1);
        System.out.println(res);
    }
}
